Populates a class implementing the
ICustomPersister interface with data.
Syntax
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As ObjectContext
Dim customPersister As ICustomPersister
Dim conditions As String
Dim parameters() As Object
Dim value As ICustomPersister
value = instance.GetObject(Of T)(customPersister, conditions, parameters)
|
Parameters
- customPersister
- The class implementing the ICustomPersister
interface.
- conditions
- A condition string that specifies the object that is loaded.
- parameters
- A list of parameter that is passed as parameter for the conditions.
Type Parameters
- T
Return Value
The first object implementing the
ICustomPersister interface.
Example
The following example introduces to the use of the GetObject routine
with the ICustomPersister interface.
| C# | Copy Code |
|---|
// Creates a new ObjectContext that uses an MsSql Server as storage. ObjectContext context = new ObjectContext(new MsSqlStorage("sa", "", "localhost", "application")); // ... Other code. // Populates the given ObjectSet with data. ObjectSet<User> = context.GetObject<User>(new ObjectSet<User>(), "Name like {0} SortBy Name Asc", "%mith%"); |
Remarks
Requirements
Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family
See Also